package com.linglingC.mapper;


import com.linglingC.pojo.Emplyee;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface EmplyeeMapper {

    @Select("select * from emplyee")
    ArrayList<Emplyee> findAll();

    List<Emplyee> selectP(Emplyee emplyee);

    @Options(useGeneratedKeys = true,keyProperty = "ID")
    @Insert("INSERT INTO emplyee (name, gender, telephone, idcard, address) " +
            "values (#{name},#{gender},#{telephone},#{idcard},#{address})")
    void addEmplyee(Emplyee emplyee);

    @Delete("delete  from emplyee where ID= #{ID}")
    void deleteOneEmplyee(Integer ID);

    @Update("update emplyee set name=#{name},gender=#{gender},telephone=#{telephone},idcard=#{idcard},address=#{address} " +
            "where ID=#{ID}")
    void editEmplyee(Emplyee emplyee);
}
